<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script type="text/javascript">

	function loadClassInfo(){
		var s_gradeId=$("#s_gradeId").val();
		$("#s_classId option[value!='-1']").remove();
		if(s_gradeId==-1){
			$("#s_classId").val("-1");
			return;
		}
		$.post("class!getClassByGradeId",{s_gradeId:s_gradeId},
				function(result){
					$("#s_classId").val("-1");
					var result = eval('('+result+')');
					$.each(result, function(i, item) {  
                        $("<option value='" + item.classId + "'>" + item.className + "</option>").appendTo($("#s_classId"));  
                    }); 
				}
			);
	}
	
	function resetValue(){
		$("#s_stuNo").val("");
		$("#s_stuName").val("");
		$("#s_stuSex").val("-1");
		$("#s_stuNation").val("-1");
		$("#s_gradeId").val("-1");
		$("#s_classId").val("-1");
		$("#s_b_stuBirthday").val("");
		$("#s_e_stuBirthday").val("");
		$("#s_b_stuRxsj").val("");
		$("#s_e_stuRxsj").val("");
	}
</script>
<div class="data_list">
	<div class="search_content">
		<form action="${pageContext.request.contextPath}/studentSearch!studentSearch" method="post" >
			<table align="center">
				<tr>
					<td><label>学号：</label></td>
					<td><input type="text" id="s_stuNo" name="s_student.stuNo" value="${s_student.stuNo }"/></td>
					<td width="30px;">&nbsp;</td>
					<td><label>姓名：</label></td>
					<td><input type="text" id="s_stuName" name="s_student.stuName" value="${s_student.stuName }"/></td>
				</tr>

				<tr>
					<td colspan="2" align="right">
						<button class="btn btn-primary" type="submit" >查询</button>
					</td>
					<td>&nbsp;</td>
					<td colspan="2" align="left">
						<button class="btn btn-primary" type="button" onclick="resetValue()">重置</button>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div class="data_content">
		<table class="table table-bordered table-hover">
			 <tr>
				<th>序号</th>
				<th>学号</th>
				<th>姓名</th>
				<th>性别</th>
				<th>出生日期</th>
				<th>入学时间</th>
				<th>所在班级</th>
				<th>所在年级</th>
			</tr>
			<c:forEach var="student" items="${studentList}" varStatus="status" >
				<tr>
					<td>${status.index+1 }</td>
					<td>${student.stuNo }</td>
					<td>${student.stuName }</td>
					<td>${student.stuSex }</td>
					<td><fmt:formatDate value="${student.stuBirthday }" type="date" pattern="yyyy-MM-dd" /></td>
					<td><fmt:formatDate value="${student.stuRxsj }" type="date" pattern="yyyy-MM-dd" /></td>
					<td>${student.className }</td>
					<td>${student.gradeName }</td>
				</tr>
			</c:forEach>
	  </table>
	</div>
	<div class="pagination pagination-centered">
	 	 <ul>
	    	${pageCode }
	 	 </ul>
	</div>
</div>